import java.lang.Math;
import java.lang.Object;
import java.util.ArrayList;
import java.util.LinkedList;

import sun.management.Sensor;

public class SensorNetwork {

	/**
	 * @param args
	 */

	//Any new SN must be assigned a number that follows the number assigned to the last SN being added to the grid. 
	//Numbers assigned to the SNs that run out of energy resources (dead nodes) must not be reused. 
	private int sn_number = 1;
	
	//testing use of the linked list ADT
	LinkedList linked_list = new LinkedList();
	sn_node sn = new sn_node(sn_number, 12, 15, 20);
	//linked_list.add(sn);


	public int transmit_message(int node_number) {
		//		Transmit Message (T): This event makes a particular SN send a message to the CN. This particular SN will rely on all SNs, forming the path from it to the CN, 
		//		to transmit the message. After the occurrence of this event, your simulating program must (1) update the battery levels of all nodes involved in the 
		//		transmission of the message, and (2) recompute all routing tables. Remember that some of the SNs will be out of energy, and hence, they can no longer transmit, 
		//		nor can they be part of a route.
		
		//have this SN node transmit a message to the CN
		//read in constant k from file
		//read in d from file
		//sn.set_energy(k*(d^2));
		//recompute tables

		return 0;
	}

	public int deploy_sensor(int x, int y, int e) {
		//		Deploy Sensor (D): This event requires the addition of a new SN to the grid. Any new SN must be assigned a number that follows the number assigned to the 
		//		last SN being added to the grid. Numbers assigned to the SNs that run out of energy resources (dead nodes) must not be reused. Once this event occurs, the 
		//		program must recompute all DVs of all SNs.
		
		int x_position = 0;
		int y_position = 0;
		int energy = 0;
		sn_node sn = new sn_node(sn_number, x_position, y_position, energy);
		//sn_number++;
		ArrayList a = new ArrayList();
		a.add(sn);
		//recompute DVs

		return 0;
	}

	public int print_route() {
		//		 Print Route (R): This event requests the simulating program to print out to an output file, created by your program and named "372project.out", the shortest 
		//		path of a particular SN to the CN. The shortest path is a (or the) path with the least cost. The cost of a path, formed by a set of links, is the sum of the 
		//		costs of all these links. For example, if p=(SN A, SN D, SN F, CN) is a path from SN A to the CN, then the cost of p is c(A,D) + c(D,F) + c(F,CN).

		return 0;
	}

	public int print_all() {
		//		# Print All (A): This event simply prints out to the output file ("372project.out") the distance vector table of all SNs to the CN as well as the 
		//		immediate next hop for each SN.

		return 0;
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		SensorNetwork network = new SensorNetwork();
		//network.

	}

}
